package com.yanqu.road.server.cmd.zhaoshang;

import com.yanqu.road.pb.cross.group.CrossGroupProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.manger.player.GamePlayerMgr;
import com.yanqu.road.utils.YanQuMessageUtils;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.S_CROSS_ZS_GROUP_CHAT_LIST, desc = "跨服分组聊天列表(招商等)")
public class CrossZsChatListCmd  extends AbstractCommand {

    private int groupId;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        CrossGroupProto.CrossGroupChatListReqMsg.Builder reqMsg = CrossGroupProto.CrossGroupChatListReqMsg.newBuilder();
        groupId = reqMsg.getGroupId();
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        CrossGroupProto.CrossGroupChatListReqMsg.Builder reqMsg = CrossGroupProto.CrossGroupChatListReqMsg.newBuilder();
        reqMsg.setGroupId(groupId);
        YanQuMessage pbMsg = YanQuMessageUtils.buildMessage(Protocol.C_ZHAOSHANG_CHAT_LIST, reqMsg);
        GamePlayerMgr.sendPacket(player.getUserId(), pbMsg);
    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
